const vFilter = {
	formatTime(time,type) {
		let date = new Date(time)
		let h = String(date.getHours()).padStart(2, '0')
		let mm = String(date.getMinutes()).padStart(2, '0')
		let s = String(date.getSeconds()).padStart(2,'0')
		let y = date.getFullYear();
		let m = String((date.getMonth() + 1)).padStart(2, '0')
		let d = String(date.getDate()).padStart(2, '0')
    if(type === 'Y-M-D'){
      return `${y}-${m}-${d}`
    }
		return `${y}-${m}-${d} ${h}:${mm}:${s}`
	},
	contentStatusText(state, types) {
		let maps = []
		types.forEach(item => {
			maps.push([Number(item.code), item.name])
		})
		const mapData = new Map(maps)
		return mapData.get(state) ? mapData.get(state) : ''
	}
}
export default vFilter
